Update to rust master
authorAlex Crichton <alex@alexcrichton.com>
Sun, 4 Jan 2015 09:02:16 +0000 (01:02 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 5 Jan 2015 19:17:01 +0000 (11:17 -0800)
85 files changed:
Cargo.lock
Cargo.toml
src/bin/bench.rs
src/bin/build.rs
src/bin/cargo.rs
src/bin/clean.rs
src/bin/config_for_key.rs
src/bin/config_list.rs
src/bin/doc.rs
src/bin/fetch.rs
src/bin/generate_lockfile.rs
src/bin/git_checkout.rs
src/bin/help.rs
src/bin/locate_project.rs
src/bin/login.rs
src/bin/new.rs
src/bin/owner.rs
src/bin/package.rs
src/bin/pkgid.rs
src/bin/publish.rs
src/bin/read_manifest.rs
src/bin/run.rs
src/bin/search.rs
src/bin/test.rs
src/bin/update.rs
src/bin/verify_project.rs
src/bin/version.rs
src/bin/yank.rs
src/cargo/core/dependency.rs
src/cargo/core/manifest.rs
src/cargo/core/package.rs
src/cargo/core/package_id.rs
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/shell.rs
src/cargo/core/source.rs
src/cargo/core/summary.rs
src/cargo/lib.rs
src/cargo/ops/cargo_clean.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_read_manifest.rs
src/cargo/ops/cargo_run.rs
src/cargo/ops/cargo_rustc/compilation.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/engine.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/ops/cargo_rustc/job.rs
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/ops/cargo_rustc/layout.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/cargo_test.rs
src/cargo/ops/lockfile.rs
src/cargo/ops/resolve.rs
src/cargo/sources/git/source.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/path.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
src/cargo/util/dependency_queue.rs
src/cargo/util/errors.rs
src/cargo/util/graph.rs
src/cargo/util/process_builder.rs
src/cargo/util/sha256.rs
src/cargo/util/to_url.rs
src/cargo/util/toml.rs
src/registry/Cargo.toml
src/registry/lib.rs
src/rustversion.txt
tests/resolve.rs
tests/support/git.rs
tests/support/mod.rs
tests/support/paths.rs
tests/support/registry.rs
tests/test_cargo.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_path_deps.rs
tests/test_cargo_publish.rs
tests/test_cargo_registry.rs
tests/test_cargo_search.rs
tests/test_shell.rs
tests/tests.rs

index d8b7a806664af08f32035f8696c8ef3499a81a6f..0f08ca28499267c83de89e711de0fd90ada02418 100644 (file)
@@ -2,54 +2,54 @@
 name = "cargo"
 version = "0.1.0"
 dependencies = [
- "curl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "flate2 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "git2 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "glob 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "flate2 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "git2 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "glob 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
- "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "registry 0.1.0",
- "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "semver 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "tar 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "semver 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tar 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "curl"
-version = "0.1.4"
+version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "curl-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "curl-sys"
-version = "0.1.2"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "docopt"
-version = "0.6.21"
+version = "0.6.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "flate2"
-version = "0.1.1"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "miniz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -57,22 +57,22 @@ dependencies = [
 
 [[package]]
 name = "gcc"
-version = "0.1.2"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "git2"
-version = "0.1.5"
+version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libgit2-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libgit2-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "glob"
-version = "0.1.3"
+version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -82,30 +82,30 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#4ae58daf0b3a853ffd
 
 [[package]]
 name = "libgit2-sys"
-version = "0.1.4"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libssh2-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libssh2-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libressl-pnacl-sys"
-version = "2.1.0"
+version = "2.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "pnacl-build-helper 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pnacl-build-helper 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "libssh2-sys"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -113,15 +113,15 @@ name = "libz-sys"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "log"
-version = "0.1.5"
+version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -129,85 +129,85 @@ name = "miniz-sys"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "openssl-sys"
-version = "0.2.10"
+version = "0.2.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libressl-pnacl-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "pkg-config 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libressl-pnacl-sys 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "pkg-config"
-version = "0.1.2"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "pnacl-build-helper"
-version = "1.0.0"
+version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "regex"
-version = "0.1.5"
+version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "registry"
 version = "0.1.0"
 dependencies = [
- "curl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rustc-serialize"
-version = "0.1.5"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "semver"
-version = "0.1.7"
+version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "tar"
-version = "0.1.3"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "term"
-version = "0.1.1"
+version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "time"
-version = "0.1.5"
+version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "toml"
-version = "0.1.7"
+version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "url"
-version = "0.2.9"
+version = "0.2.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustc-serialize 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
index 4587eecb30b00dd70e1fa925e5613ffbe1eb1e86..8ff3ffba1f27fbe5795dc20e9bd264137598b890 100644 (file)
@@ -15,18 +15,18 @@ name = "cargo"
 path = "src/cargo/lib.rs"
 
 [dependencies]
-toml = "0.1.7"
-semver = "0.1.6"
-curl = "0.1.3"
-tar = "0.1.3"
-flate2 = "0.1.0"
-git2 = "0.1.0"
-glob = "0.1.0"
-time = "0.1.0"
-log = "0.1.0"
-docopt = "0.6.19"
-url = "0.2.7"
-rustc-serialize = "0.1.5"
+toml = "0.1"
+semver = "0.1"
+curl = "0.1"
+tar = "0.1"
+flate2 = "0.1"
+git2 = "0.1"
+glob = "0.1"
+time = "0.1"
+log = "0.1"
+docopt = "0.6"
+url = "0.2"
+rustc-serialize = "0.2"
 term = "0.1"
 
 [dev-dependencies.hamcrest]
index ac591a677b23c8992ad322226a199ccb5cc97766..560df512c1dbdc090ce7c0f80c8b9f2c1c92afc7 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, Human};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_no_run: bool,
     flag_package: Option<String>,
index aafd93bff90489fbdcee32bac5db9948e314f7a3..c23c323b011170bf4a5e3188946a8ba2b1517430 100644 (file)
@@ -6,7 +6,7 @@ use cargo::ops;
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 use cargo::util::{CliResult, CliError};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_package: Option<String>,
     flag_jobs: Option<uint>,
index 95a160fd85e3419f93b2f7015789a1dfba2f40a5..149be5123b2c1a81846bc50be971af5249323023 100644 (file)
@@ -1,4 +1,4 @@
-#![feature(phase, macro_rules)]
+#![feature(phase, macro_rules, old_orphan_check)]
 
 extern crate "rustc-serialize" as rustc_serialize;
 #[phase(plugin, link)] extern crate log;
@@ -7,14 +7,14 @@ extern crate "rustc-serialize" as rustc_serialize;
 use std::collections::BTreeSet;
 use std::os;
 use std::io;
-use std::io::fs::{mod, PathExtensions};
+use std::io::fs::{self, PathExtensions};
 use std::io::process::{Command,InheritFd,ExitStatus,ExitSignal};
 
 use cargo::{execute_main_without_stdin, handle_error, shell};
 use cargo::core::MultiShell;
 use cargo::util::{CliError, CliResult, lev_distance};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Flags {
     flag_list: bool,
     flag_verbose: bool,
index 56c9cfcb848ab79bb6fc8830e1a6a6e6b69c69ab..d5046d3560eb42da683e97c5f42117386d1fc1fe 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_package: Option<String>,
     flag_target: Option<String>,
index 03ee07210769b009f8a064c53408c67f1eeb2440..1602ea1216f7f805b135cc6161aaf8aaf8978e9e 100644 (file)
@@ -4,13 +4,13 @@ use std::collections::HashMap;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, config};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct ConfigForKeyFlags {
     flag_human: bool,
     flag_key: String,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 struct ConfigOut {
     values: HashMap<String, config::ConfigValue>
 }
index e7659f51a8bf100edf859e5f37e1c6351700671c..0fdf7e670e3d38b0288ec646c7f1bbc167f88912 100644 (file)
@@ -4,12 +4,12 @@ use std::collections::HashMap;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, config};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct ConfigListFlags {
     flag_human: bool,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 struct ConfigOut {
     values: HashMap<String, config::ConfigValue>
 }
index 28c273380807bb0d76fc79cbfdf4ebf583ba6cd3..daf8e31229190925b836643c6ac3ba2f6866d31e 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_features: Vec<String>,
     flag_jobs: Option<uint>,
index 96adca0ba1610d34586e13605daf0ca9cf1f790a..98e33f3b492c0ec830926ac6b4e5cd9716e24b3e 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: bool,
index cc44260387457734fec0c2057bbc8d2395314f06..e1fe72e3fbb94d5e831a9b2a813e8fc12b93970f 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: bool,
index 8e2712cdcf60a0a80fa617094c00daf4258d35f3..1a19a3423d3eb8454a82c3cb7fe18963821636fd 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::source::{Source, SourceId, GitReference};
 use cargo::sources::git::{GitSource};
 use cargo::util::{Config, CliResult, CliError, human, ToUrl};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_url: String,
     flag_reference: String,
index d57415b5b190399cffa3963ba80d9bf029c3017c..c21dbefebef096325e224e99f39d850104fcf2a2 100644 (file)
@@ -1,7 +1,7 @@
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options;
 
 pub const USAGE: &'static str = "
index 9162a7edb73992ba5e041fce0ff268837ef4638f..0644cb8649eecf625462f5a035f38cdf1e98c3e1 100644 (file)
@@ -2,7 +2,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, human, ChainError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct LocateProjectFlags {
     flag_manifest_path: Option<String>,
 }
@@ -16,7 +16,7 @@ Options:
     -h, --help              Print this message
 ";
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 struct ProjectLocation {
     root: String
 }
index 0310f9086aea76dec0925b6c996ff04c7a889f7f..9b00c6508974069e1a373f588c5b7ddb2429400c 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::{MultiShell, SourceId, Source};
 use cargo::sources::RegistrySource;
 use cargo::util::{CliResult, CliError, Config};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     arg_token: Option<String>,
index 80f6c5999f96dd4a94820ea1f10bc0532966cc93..2fa346c6125c5ec0d5cd6644c1a2144e5537e6c8 100644 (file)
@@ -4,7 +4,7 @@ use cargo::ops;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_bin: bool,
index a4cf36f6564d16de0dbd38ca392028906b985a41..b0bfcc3f67904da46a2ba98be53ad5661bc7b038 100644 (file)
@@ -2,7 +2,7 @@ use cargo::ops;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index dbc91e42c6ec64775ebd63d3b4aced957222df51..bf8f1a01cd3198e3a9850fdaf84ae2741644ffe3 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_manifest_path: Option<String>,
index 8cb91e0ae4be184dd1231a350a90a9710e6a59dc..53f09b099cf039f1ecc69fc2bd835a8a4a12398a 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_manifest_path: Option<String>,
index 07e1625de4b0aad859003d215fb57398b8b038e4..14327230600a4669a914db77c5b5a87293612f00 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     flag_token: Option<String>,
index 03a85f850c3a9fa5122709725fd6b8c938d58c16..fe8d88be0454e6e12019c86c285ebc5d44b2b142 100644 (file)
@@ -2,7 +2,7 @@ use cargo::core::{MultiShell, Package, Source};
 use cargo::util::{CliResult, CliError};
 use cargo::sources::{PathSource};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_manifest_path: String,
 }
index 9883e5c044a92b603d02d56a7f5009c352bce558..473d847bdea33fd9644f2b472a19d210c0c830f5 100644 (file)
@@ -6,7 +6,7 @@ use cargo::core::manifest::TargetKind;
 use cargo::util::{CliResult, CliError, human};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_bin: Option<String>,
     flag_example: Option<String>,
index 706100112ae53d86c51e0013fcbb8696899ea8c2..a973d14f65390b3595f5876a8388b708c7337d31 100644 (file)
@@ -2,7 +2,7 @@ use cargo::ops;
 use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     flag_verbose: bool,
index 26a3346dc0f76605ae658b3341a68be2b8ef3e19..b22b01e00872ad65cd5df37e61189e1210f69375 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, Human};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     arg_args: Vec<String>,
     flag_features: Vec<String>,
index 47596ba74a18e382035bbdaf9d0bc2279a507aff..1e3dec520e0bdec2dd55199e08e4a6e4b9d1217b 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     arg_spec: Option<String>,
     flag_package: Option<String>,
index 4bd04adfa578bd3b322d4d18a1f42d7713197dce..5445bc91958d7d7962040ca326b630b234651ddd 100644 (file)
@@ -9,7 +9,7 @@ use cargo::util::CliResult;
 
 pub type Error = HashMap<String, String>;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Flags {
     flag_manifest_path: String,
     flag_verbose: bool,
index 02fcb0cff9d33fdfbb50eb39ef8f5726d5fdb926..1f9212e574a080e87c7351cd27e323f5d911cfb8 100644 (file)
@@ -4,7 +4,7 @@ use cargo;
 use cargo::core::MultiShell;
 use cargo::util::CliResult;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options;
 
 pub const USAGE: &'static str = "
index 2103f69c82843d2eb3031d8bc786dc4bfee1f941..a0e78907215cbf82c67d65059fc7cfecc4a8a8b8 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index 76e9f97c6fcb7e47596b012cd6adc9f5d9421817..a26e7eace1e1c7937ed7d510262f4e9e8c9b1a51 100644 (file)
@@ -4,7 +4,7 @@ use core::{SourceId, Summary, PackageId};
 use util::CargoResult;
 
 /// Informations about a dependency requested by a Cargo manifest.
-#[deriving(PartialEq,Clone,Show)]
+#[derive(PartialEq,Clone,Show)]
 pub struct Dependency {
     name: String,
     source_id: SourceId,
@@ -22,7 +22,7 @@ pub struct Dependency {
     only_for_platform: Option<String>,
 }
 
-#[deriving(PartialEq, Clone, Show, Copy)]
+#[derive(PartialEq, Clone, Show, Copy)]
 pub enum Kind {
     Normal,
     Development,
@@ -184,7 +184,7 @@ impl Dependency {
     }
 }
 
-#[deriving(PartialEq,Clone,RustcEncodable)]
+#[derive(PartialEq,Clone,RustcEncodable)]
 pub struct SerializedDependency {
     name: String,
     req: String
index 2953001a73ea7133859d576e4d688f3272b63942..48b7a7f55e48f93d155b79e4a59b235c9d097e5b 100644 (file)
@@ -1,5 +1,5 @@
 use std::hash;
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 
 use semver::Version;
 use rustc_serialize::{Encoder,Encodable};
@@ -10,7 +10,7 @@ use core::dependency::SerializedDependency;
 use util::{CargoResult, human};
 
 /// Contains all the informations about a package, as loaded from a Cargo.toml.
-#[deriving(PartialEq,Clone)]
+#[derive(PartialEq,Clone)]
 pub struct Manifest {
     summary: Summary,
     targets: Vec<Target>,
@@ -40,7 +40,7 @@ impl Show for Manifest {
 /// validated by cargo itself, but rather it is up to the registry when uploaded
 /// to validate these fields. Cargo will itself accept any valid TOML
 /// specification for these values.
-#[deriving(PartialEq, Clone)]
+#[derive(PartialEq, Clone)]
 pub struct ManifestMetadata {
     pub authors: Vec<String>,
     pub keywords: Vec<String>,
@@ -53,7 +53,7 @@ pub struct ManifestMetadata {
     pub documentation: Option<String>,  // url
 }
 
-#[deriving(PartialEq,Clone,RustcEncodable)]
+#[derive(PartialEq,Clone,RustcEncodable)]
 pub struct SerializedManifest {
     name: String,
     version: String,
@@ -81,7 +81,7 @@ impl<E, S: Encoder<E>> Encodable<S, E> for Manifest {
     }
 }
 
-#[deriving(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)]
+#[derive(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)]
 pub enum LibKind {
     Lib,
     Rlib,
@@ -116,14 +116,14 @@ impl LibKind {
     }
 }
 
-#[deriving(Show, Clone, Hash, PartialEq, RustcEncodable)]
+#[derive(Show, Clone, Hash, PartialEq, RustcEncodable)]
 pub enum TargetKind {
     Lib(Vec<LibKind>),
     Bin,
     Example,
 }
 
-#[deriving(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)]
+#[derive(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)]
 pub struct Profile {
     env: String, // compile, test, dev, bench, etc.
     opt_level: uint,
@@ -351,7 +351,7 @@ impl<H: hash::Writer> hash::Hash<H> for Profile {
 }
 
 /// Informations about a binary, a library, an example, etc. that is part of the package.
-#[deriving(Clone, Hash, PartialEq)]
+#[derive(Clone, Hash, PartialEq)]
 pub struct Target {
     kind: TargetKind,
     name: String,
@@ -360,7 +360,7 @@ pub struct Target {
     metadata: Option<Metadata>,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 pub struct SerializedTarget {
     kind: Vec<&'static str>,
     name: String,
index 75f73e52c30619e78b56f1f462cdb062b383fa34..794ccd3d354ade1518c26c6bcf31f624def50166 100644 (file)
@@ -1,4 +1,4 @@
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 use std::hash;
 use std::slice;
 use semver::Version;
@@ -20,7 +20,7 @@ use core::source::{SourceId, Source};
 ///
 /// A package is a `Cargo.toml` file, plus all the files that are part of it.
 // TODO: Is manifest_path a relic?
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct Package {
     // The package's manifest
     manifest: Manifest,
@@ -30,7 +30,7 @@ pub struct Package {
     source_id: SourceId,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 struct SerializedPackage {
     name: String,
     version: String,
@@ -137,7 +137,7 @@ impl hash::Hash for Package {
     }
 }
 
-#[deriving(PartialEq,Clone,Show)]
+#[derive(PartialEq,Clone,Show)]
 pub struct PackageSet {
     packages: Vec<Package>,
 }
index 80aa1f694f754e08dda546dbda9f6f5332cbef87..a3db63d48d00e9b11933880925b2a629454cccff 100644 (file)
@@ -1,23 +1,24 @@
-use semver;
+use std::cmp::Ordering;
 use std::error::{Error, FromError};
+use std::fmt::{self, Show, Formatter};
 use std::hash::Hash;
-use std::sync::Arc;
-use std::fmt::{mod, Show, Formatter};
 use std::hash;
-use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
+use std::sync::Arc;
 
 use regex::Regex;
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
+use semver;
 
 use util::{CargoResult, CargoError, short_hash, ToSemver};
 use core::source::SourceId;
 
 /// Identifier for a specific version of a package in a specific source.
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct PackageId {
     inner: Arc<PackageIdInner>,
 }
 
-#[deriving(PartialEq, PartialOrd, Eq, Ord)]
+#[derive(PartialEq, PartialOrd, Eq, Ord)]
 struct PackageIdInner {
     name: String,
     version: semver::Version,
@@ -80,7 +81,7 @@ impl Ord for PackageId {
     }
 }
 
-#[deriving(Clone, Show, PartialEq)]
+#[derive(Clone, Show, PartialEq)]
 pub enum PackageIdError {
     InvalidVersion(String),
     InvalidNamespace(String)
@@ -108,7 +109,7 @@ impl FromError<PackageIdError> for Box<CargoError> {
     fn from_error(t: PackageIdError) -> Box<CargoError> { box t }
 }
 
-#[deriving(PartialEq, Hash, Clone, RustcEncodable)]
+#[derive(PartialEq, Hash, Clone, RustcEncodable)]
 pub struct Metadata {
     pub metadata: String,
     pub extra_filename: String
index 8bc5ae446d69ab84cf3e286a0ef6866dd28d7c95..dce16d30c5ee5326f7ed6013217b441b9d3d2d21 100644 (file)
@@ -1,11 +1,11 @@
 use std::fmt;
 use semver::Version;
-use url::{mod, Url, UrlParser};
+use url::{self, Url, UrlParser};
 
 use core::PackageId;
 use util::{CargoResult, ToUrl, human, ToSemver, ChainError};
 
-#[deriving(Clone, PartialEq, Eq)]
+#[derive(Clone, PartialEq, Eq)]
 pub struct PackageIdSpec {
     name: String,
     version: Option<Version>,
index 4bda4840824b0f4981f984b8e6e1a31c9e0287f3..dfa9aa1161f5b96e2b582a7a4d6a92171825f11b 100644 (file)
@@ -64,7 +64,7 @@ pub struct PackageRegistry<'a> {
     locked: HashMap<SourceId, HashMap<String, Vec<(PackageId, Vec<PackageId>)>>>,
 }
 
-#[deriving(PartialEq, Eq, Copy)]
+#[derive(PartialEq, Eq, Copy)]
 enum Kind {
     Override,
     Locked,
@@ -152,13 +152,15 @@ impl<'a> PackageRegistry<'a> {
     }
 
     pub fn register_lock(&mut self, id: PackageId, deps: Vec<PackageId>) {
-        let sub_map = match self.locked.entry(id.get_source_id().clone()) {
+        let source = id.get_source_id().clone();
+        let sub_map = match self.locked.entry(&source) {
             Occupied(e) => e.into_mut(),
-            Vacant(e) => e.set(HashMap::new()),
+            Vacant(e) => e.insert(HashMap::new()),
         };
-        let sub_vec = match sub_map.entry(id.get_name().to_string()) {
+        let name = id.get_name().to_string();
+        let sub_vec = match sub_map.entry(&name) {
             Occupied(e) => e.into_mut(),
-            Vacant(e) => e.set(Vec::new()),
+            Vacant(e) => e.insert(Vec::new()),
         };
         sub_vec.push((id, deps));
     }
index a469ed2b2f3dc0f32acfbe0efd0850ac1e646714..baae96b956a4511a8dbf801d3b2f63af5170a1c4 100644 (file)
@@ -8,7 +8,7 @@ use util::{CargoResult, Graph};
 
 use super::Resolve;
 
-#[deriving(RustcEncodable, RustcDecodable, Show)]
+#[derive(RustcEncodable, RustcDecodable, Show)]
 pub struct EncodableResolve {
     package: Option<Vec<EncodableDependency>>,
     root: EncodableDependency,
@@ -76,7 +76,7 @@ impl EncodableResolve {
     }
 }
 
-#[deriving(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)]
+#[derive(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)]
 pub struct EncodableDependency {
     name: String,
     version: String,
@@ -93,7 +93,7 @@ impl EncodableDependency {
     }
 }
 
-#[deriving(Show, PartialOrd, Ord, PartialEq, Eq)]
+#[derive(Show, PartialOrd, Ord, PartialEq, Eq)]
 pub struct EncodablePackageId {
     name: String,
     version: String,
index 1a1f9423c1377eaf964dab1c5a9d240e8eecb83b..09e2fca382d51678ea425ea83d1bef2df4b34074 100644 (file)
@@ -22,7 +22,7 @@ mod encode;
 ///
 /// Each instance of `Resolve` also understands the full set of features used
 /// for each package as well as what the root package is.
-#[deriving(PartialEq, Eq, Clone)]
+#[derive(PartialEq, Eq, Clone)]
 pub struct Resolve {
     graph: Graph<PackageId>,
     features: HashMap<PackageId, HashSet<String>>,
@@ -30,7 +30,7 @@ pub struct Resolve {
     metadata: Option<Metadata>,
 }
 
-#[deriving(Copy)]
+#[derive(Copy)]
 pub enum Method<'a> {
     Everything,
     Required(/* dev_deps = */ bool,
@@ -92,11 +92,10 @@ impl Resolve {
                     spec: &PackageIdSpec) {
             let mut version_cnt = HashMap::new();
             for id in ids.iter() {
-                let slot = match version_cnt.entry(id.get_version()) {
-                    Occupied(e) => e.into_mut(),
-                    Vacant(e) => e.set(0u),
-                };
-                *slot += 1;
+                match version_cnt.entry(&id.get_version()) {
+                    Vacant(e) => { e.insert(1u); }
+                    Occupied(e) => *e.into_mut() += 1u,
+                }
             }
             for id in ids.iter() {
                 if version_cnt[id.get_version()] == 1 {
@@ -122,7 +121,7 @@ impl fmt::Show for Resolve {
     }
 }
 
-#[deriving(Clone)]
+#[derive(Clone)]
 struct Context {
     activations: HashMap<(String, SourceId), Vec<Rc<Summary>>>,
     resolve: Resolve,
@@ -241,9 +240,9 @@ fn activate_deps<'a, R: Registry>(cx: Context,
         let early_return = {
             my_cx.resolve.graph.link(parent.get_package_id().clone(),
                                      candidate.get_package_id().clone());
-            let prev = match my_cx.activations.entry(key.clone()) {
+            let prev = match my_cx.activations.entry(&key) {
                 Occupied(e) => e.into_mut(),
-                Vacant(e) => e.set(Vec::new()),
+                Vacant(e) => e.insert(Vec::new()),
             };
             if prev.iter().any(|c| c == candidate) {
                 match cx.resolve.features(candidate.get_package_id()) {
@@ -408,10 +407,10 @@ fn resolve_features<'a>(cx: &mut Context, parent: &'a Summary,
 
     // Record what list of features is active for this package.
     if used_features.len() > 0 {
-        let pkgid = parent.get_package_id().clone();
+        let pkgid = parent.get_package_id();
         match cx.resolve.features.entry(pkgid) {
             Occupied(entry) => entry.into_mut(),
-            Vacant(entry) => entry.set(HashSet::new()),
+            Vacant(entry) => entry.insert(HashSet::new()),
         }.extend(used_features.into_iter());
     }
 
@@ -478,9 +477,9 @@ fn build_features(s: &Summary, method: Method)
         match parts.next() {
             Some(feat) => {
                 let package = feat_or_package;
-                match deps.entry(package.to_string()) {
+                match deps.entry(package) {
                     Occupied(e) => e.into_mut(),
-                    Vacant(e) => e.set(Vec::new()),
+                    Vacant(e) => e.insert(Vec::new()),
                 }.push(feat.to_string());
             }
             None => {
@@ -499,9 +498,9 @@ fn build_features(s: &Summary, method: Method)
                         }
                     }
                     None => {
-                        match deps.entry(feat.to_string()) {
+                        match deps.entry(feat) {
                             Occupied(..) => {} // already activated
-                            Vacant(e) => { e.set(Vec::new()); }
+                            Vacant(e) => { e.insert(Vec::new()); }
                         }
                     }
                 }
index 10965255519996bd728e358dc39dc485f220412b..8d25db75ebee753b813638a9bc87209a159069f5 100644 (file)
@@ -6,7 +6,7 @@ use std::fmt::Show;
 
 use self::AdequateTerminal::{NoColor, Colored};
 
-#[deriving(Copy)]
+#[derive(Copy)]
 pub struct ShellConfig {
     pub color: bool,
     pub verbose: bool,
index 36b9ae2862d9d3c715712b0388de397457ac6823..de7b3ea6494a21a5c8b0f6143cef96dff156c82f 100644 (file)
@@ -1,5 +1,6 @@
 use std::collections::hash_map::{HashMap, Values, IterMut};
-use std::fmt::{mod, Show, Formatter};
+use std::cmp::Ordering;
+use std::fmt::{self, Show, Formatter};
 use std::hash;
 use std::mem;
 use std::sync::Arc;
@@ -42,7 +43,7 @@ pub trait Source: Registry {
     fn fingerprint(&self, pkg: &Package) -> CargoResult<String>;
 }
 
-#[deriving(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[derive(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 enum Kind {
     /// Kind::Git(<git reference>) represents a git repository
     Git(GitReference),
@@ -52,7 +53,7 @@ enum Kind {
     Registry,
 }
 
-#[deriving(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[derive(Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub enum GitReference {
     Tag(String),
     Branch(String),
@@ -62,12 +63,12 @@ pub enum GitReference {
 type Error = Box<CargoError + Send>;
 
 /// Unique identifier for a source of packages.
-#[deriving(Clone, Eq)]
+#[derive(Clone, Eq)]
 pub struct SourceId {
     inner: Arc<SourceIdInner>,
 }
 
-#[deriving(Eq, Clone)]
+#[derive(Eq, Clone)]
 struct SourceIdInner {
     url: Url,
     kind: Kind,
@@ -406,9 +407,8 @@ impl<'src> SourceMap<'src> {
     }
 }
 
-impl<'a, 'src> Iterator<(&'a SourceId, &'a mut (Source + 'src))>
-    for SourcesMut<'a, 'src>
-{
+impl<'a, 'src> Iterator for SourcesMut<'a, 'src> {
+    type Item = (&'a SourceId, &'a mut (Source + 'src));
     fn next(&mut self) -> Option<(&'a SourceId, &'a mut (Source + 'src))> {
         self.inner.next().map(|(a, b)| (a, &mut **b))
     }
index f750e00806f5d8563a16824dd616edf7e48c0d40..e73ae60c7fe2f6f44ec1ad366000145b540f3bbb 100644 (file)
@@ -10,7 +10,7 @@ use util::{CargoResult, human};
 /// a package.
 ///
 /// Summaries are cloned, and should not be mutated after creation
-#[deriving(Show,Clone)]
+#[derive(Show,Clone)]
 pub struct Summary {
     package_id: PackageId,
     dependencies: Vec<Dependency>,
index d20f5dcf287d9b9a3480bab8a619e90cbbc336e4..799c9e7b041d090b094b6dcd8d39a05bc31eb938 100644 (file)
@@ -2,7 +2,7 @@
 #![crate_type="rlib"]
 
 #![feature(macro_rules, phase, default_type_params, unboxed_closures)]
-#![feature(slicing_syntax)]
+#![feature(slicing_syntax, old_orphan_check, associated_types)]
 #![deny(unused)]
 #![cfg_attr(test, deny(warnings))]
 
@@ -26,12 +26,13 @@ extern crate url;
 
 extern crate registry;
 
-use std::os;
 use std::error::Error;
+use std::fmt;
 use std::io::stdio::{stdout_raw, stderr_raw};
-use std::io::{mod, stdout, stderr};
+use std::io::{self, stdout, stderr};
+use std::os;
 use rustc_serialize::{Decoder, Encoder, Decodable, Encodable};
-use rustc_serialize::json;
+use rustc_serialize::json::{self, Json};
 use docopt::Docopt;
 
 use core::{Shell, MultiShell, ShellConfig};
@@ -64,48 +65,52 @@ pub mod util;
 pub trait RepresentsJSON : Decodable<json::Decoder, json::DecoderError> {}
 impl<T: Decodable<json::Decoder, json::DecoderError>> RepresentsJSON for T {}
 
-pub fn execute_main<'a,
-                    T: Decodable<docopt::Decoder, docopt::Error>,
-                    U: RepresentsJSON,
-                    V: Encodable<json::Encoder<'a>, io::IoError>>(
+pub fn execute_main<T, U, V>(
                         exec: fn(T, U, &mut MultiShell) -> CliResult<Option<V>>,
                         options_first: bool,
-                        usage: &str) {
+                        usage: &str)
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>,
+          T: Decodable<docopt::Decoder, docopt::Error>,
+          U: RepresentsJSON
+{
     process::<V>(|rest, shell| call_main(exec, shell, usage, rest, options_first));
 }
 
-pub fn call_main<'a,
-        T: Decodable<docopt::Decoder, docopt::Error>,
-        U: RepresentsJSON,
-        V: Encodable<json::Encoder<'a>, io::IoError>>(
+pub fn call_main<T, U, V>(
             exec: fn(T, U, &mut MultiShell) -> CliResult<Option<V>>,
             shell: &mut MultiShell,
             usage: &str,
             args: &[String],
-            options_first: bool) -> CliResult<Option<V>> {
+            options_first: bool) -> CliResult<Option<V>>
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>,
+          T: Decodable<docopt::Decoder, docopt::Error>,
+          U: RepresentsJSON
+{
     let flags = try!(flags_from_args::<T>(usage, args, options_first));
     let json = try!(json_from_stdin::<U>());
 
     exec(flags, json, shell)
 }
 
-pub fn execute_main_without_stdin<'a,
-                                  T: Decodable<docopt::Decoder, docopt::Error>,
-                                  V: Encodable<json::Encoder<'a>, io::IoError>>(
+pub fn execute_main_without_stdin<T, V>(
                                       exec: fn(T, &mut MultiShell) -> CliResult<Option<V>>,
                                       options_first: bool,
-                                      usage: &str) {
+                                      usage: &str)
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>,
+          T: Decodable<docopt::Decoder, docopt::Error>
+{
     process::<V>(|rest, shell| call_main_without_stdin(exec, shell, usage, rest,
                                                        options_first));
 }
 
-pub fn execute_main_with_args_and_without_stdin<'a,
-                                  T: Decodable<docopt::Decoder, docopt::Error>,
-                                  V: Encodable<json::Encoder<'a>, io::IoError>>(
+pub fn execute_main_with_args_and_without_stdin<T, V>(
                                       exec: fn(T, &mut MultiShell) -> CliResult<Option<V>>,
                                       options_first: bool,
                                       usage: &str,
-                                      args: &[String]) {
+                                      args: &[String])
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>,
+          T: Decodable<docopt::Decoder, docopt::Error>
+{
     let mut shell = shell(true);
 
     process_executed(
@@ -113,28 +118,30 @@ pub fn execute_main_with_args_and_without_stdin<'a,
         &mut shell)
 }
 
-pub fn call_main_without_stdin<'a,
-                               T: Decodable<docopt::Decoder, docopt::Error>,
-                               V: Encodable<json::Encoder<'a>, io::IoError>>(
+pub fn call_main_without_stdin<T, V>(
             exec: fn(T, &mut MultiShell) -> CliResult<Option<V>>,
             shell: &mut MultiShell,
             usage: &str,
             args: &[String],
-            options_first: bool) -> CliResult<Option<V>> {
+            options_first: bool) -> CliResult<Option<V>>
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>,
+          T: Decodable<docopt::Decoder, docopt::Error>
+{
     let flags = try!(flags_from_args::<T>(usage, args, options_first));
     exec(flags, shell)
 }
 
-fn process<'a, V: Encodable<json::Encoder<'a>, io::IoError>>(
-               callback: |&[String], &mut MultiShell| -> CliResult<Option<V>>) {
+fn process<V>(callback: |&[String], &mut MultiShell| -> CliResult<Option<V>>)
+    where V: for<'a> Encodable<json::Encoder<'a>, fmt::Error>
+{
     let mut shell = shell(true);
     process_executed(callback(os::args().as_slice(), &mut shell), &mut shell)
 }
 
-pub fn process_executed<'a,
-                        T: Encodable<json::Encoder<'a>, io::IoError>>(
-                            result: CliResult<Option<T>>,
-                            shell: &mut MultiShell) {
+pub fn process_executed<T>(result: CliResult<Option<T>>,
+                           shell: &mut MultiShell)
+    where T: for<'a> Encodable<json::Encoder<'a>, fmt::Error>
+{
     match result {
         Err(e) => handle_error(e, shell),
         Ok(Some(encodable)) => {
@@ -280,7 +287,7 @@ fn json_from_stdin<T: RepresentsJSON>() -> CliResult<T> {
         CliError::new("Standard in did not exist or was not UTF-8", 1)
     }));
 
-    let json = try!(json::from_str(input.as_slice()).map_err(|_| {
+    let json = try!(Json::from_str(input.as_slice()).map_err(|_| {
         CliError::new("Could not parse standard in as JSON", 1)
     }));
     let mut decoder = json::Decoder::new(json);
index c9b117b97d29d163a7e3645d960cf99b0d231020..45f1d4d172adbb6fab05d3cef962d4f8effa573d 100644 (file)
@@ -1,11 +1,11 @@
 use std::default::Default;
-use std::io::fs::{mod, PathExtensions};
+use std::io::fs::{self, PathExtensions};
 
 use core::{MultiShell, PackageSet};
 use core::source::{Source, SourceMap};
 use sources::PathSource;
 use util::{CargoResult, human, ChainError, Config};
-use ops::{mod, Layout, Context};
+use ops::{self, Layout, Context};
 
 pub struct CleanOptions<'a> {
     pub spec: Option<&'a str>,
index 1646b651755ddb58494914c534a733ab7e003d8e..2c91141cd1488d20eb19b6fa7c3c6aa4e71092aa 100644 (file)
@@ -30,7 +30,7 @@ use std::sync::Arc;
 use core::registry::PackageRegistry;
 use core::{MultiShell, Source, SourceId, PackageSet, Package, Target, PackageId};
 use core::resolver::Method;
-use ops::{mod, BuildOutput, ExecEngine};
+use ops::{self, BuildOutput, ExecEngine};
 use sources::{PathSource};
 use util::config::{Config, ConfigValue};
 use util::{CargoResult, config, internal, human, ChainError, profile};
index 1fa52c7d1e6bed9f9a8e8f745eace0d720e73bf1..de3e83ca1c97cbc050f49dd184ba50d50d7b8b28 100644 (file)
@@ -1,5 +1,5 @@
 use std::os;
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 use std::io::fs::PathExtensions;
 
 use git2::Config;
index 9e78c4f9d1d965de26b03494f6319b8cfdaffab1..02ff5999be39b4d92db821998bed3b9c141d4676 100644 (file)
@@ -1,9 +1,9 @@
 use std::collections::HashSet;
-use std::io::{mod, File, fs};
+use std::io::{self, File, fs};
 use std::io::fs::PathExtensions;
 
 use core::{Package,Manifest,SourceId};
-use util::{mod, CargoResult, human};
+use util::{self, CargoResult, human};
 use util::important_paths::find_project_manifest_exact;
 use util::toml::{Layout, project_layout};
 use std::error::FromError;
index 6293ec800bbd116204c2cf20468f022e28e5ff5b..706a74fa79f8cc1d4f31210d7022aedf6cfbba53 100644 (file)
@@ -1,6 +1,6 @@
 use std::os;
 
-use ops::{mod, ExecEngine};
+use ops::{self, ExecEngine};
 use util::{CargoResult, human, process, ProcessError, ChainError};
 use core::manifest::TargetKind;
 use core::source::Source;
index fce3bdcbc22043b05ec51b1a59dcc8fa8cf2ee93..c8313964f7facb57b2889dc6f46e8dda53c42893 100644 (file)
@@ -1,9 +1,10 @@
 use std::collections::HashMap;
+use std::c_str::ToCStr;
 use std::dynamic_lib::DynamicLibrary;
 use semver::Version;
 
 use core::{PackageId, Package};
-use util::{mod, CargoResult};
+use util::{self, CargoResult};
 
 use super::{CommandType, CommandPrototype};
 
index 1a45a0911f91b1a46a8efca83db335b8af441277..a76de7fece296fac3c05bddd7dea4dbbe40bf678 100644 (file)
@@ -4,7 +4,7 @@ use std::str;
 use std::sync::Arc;
 
 use core::{SourceMap, Package, PackageId, PackageSet, Resolve, Target};
-use util::{mod, CargoResult, ChainError, internal, Config, profile};
+use util::{self, CargoResult, ChainError, internal, Config, profile};
 use util::human;
 
 use super::{Kind, Compilation, BuildConfig};
@@ -13,7 +13,7 @@ use super::layout::{Layout, LayoutProxy};
 use super::custom_build::BuildState;
 use super::{ProcessEngine, ExecEngine};
 
-#[deriving(Show, Copy)]
+#[derive(Show, Copy)]
 pub enum Platform {
     Target,
     Plugin,
@@ -155,7 +155,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
                           req: Platform) {
 
         let req = if target.get_profile().is_for_host() {Platform::Plugin} else {req};
-        match self.requirements.entry((pkg.get_package_id(), target.get_name())) {
+        match self.requirements.entry(&(pkg.get_package_id(), target.get_name())) {
             Occupied(mut entry) => match (*entry.get(), req) {
                 (Platform::Plugin, Platform::Plugin) |
                 (Platform::PluginAndTarget, Platform::Plugin) |
@@ -164,7 +164,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
                 (Platform::PluginAndTarget, Platform::PluginAndTarget) => return,
                 _ => *entry.get_mut() = entry.get().combine(req),
             },
-            Vacant(entry) => { entry.set(req); }
+            Vacant(entry) => { entry.insert(req); }
         };
 
         for &(pkg, dep) in self.dep_targets(pkg, target).iter() {
index fcbc8b9d6d0dbfb23f467150d67693ce8a914480..f0da72f5ffd06106b082ee94139ba2e61972a6ba 100644 (file)
@@ -1,9 +1,11 @@
+use std::c_str::ToCStr;
 use std::collections::HashMap;
 use std::fmt;
 use std::io::fs::PathExtensions;
 use std::io::{fs, USER_RWX, File};
 use std::str;
 use std::sync::Mutex;
+use std::sync::mpsc::Sender;
 
 use core::{Package, Target, PackageId, PackageSet};
 use util::{CargoResult, human, Human};
@@ -15,7 +17,7 @@ use super::CommandType;
 use util::Freshness;
 
 /// Contains the parsed output of a custom build script.
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct BuildOutput {
     /// Paths to pass to rustc with the `-L` flag
     pub library_paths: Vec<Path>,
@@ -138,7 +140,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
         }
 
         // And now finally, run the build command itself!
-        desc_tx.send_opt(p.to_string()).ok();
+        desc_tx.send(p.to_string()).ok();
         let output = try!(exec_engine.exec_with_output(p).map_err(|mut e| {
             e.desc = format!("failed to run custom build command for `{}`\n{}",
                              pkg_name, e.desc);
@@ -178,7 +180,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
     // Also note that a fresh build command needs to
     let (freshness, dirty, fresh) =
             try!(fingerprint::prepare_build_cmd(cx, pkg, Some(target)));
-    let dirty = Work::new(move |tx: Sender<String>| {
+    let dirty = Work::new(move |tx| {
         try!(work(tx.clone()));
         dirty.call(tx)
     });
index 7b043b43bff26db70dfb56fa53fdaf56fc8b105d..ccd02401a3218befccf8dd9f23fa82dc6a02ce84 100644 (file)
@@ -1,9 +1,9 @@
 use std::collections::HashMap;
-use std::c_str::CString;
+use std::c_str::{CString, ToCStr};
 use std::io::process::ProcessOutput;
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 
-use util::{mod, CargoResult, ProcessError, ProcessBuilder};
+use util::{self, CargoResult, ProcessError, ProcessBuilder};
 
 /// Trait for objects that can execute commands.
 pub trait ExecEngine: Send + Sync {
@@ -12,7 +12,7 @@ pub trait ExecEngine: Send + Sync {
 }
 
 /// Default implementation of `ExecEngine`.
-#[deriving(Copy)]
+#[derive(Copy)]
 pub struct ProcessEngine;
 
 impl ExecEngine for ProcessEngine {
@@ -27,7 +27,7 @@ impl ExecEngine for ProcessEngine {
 }
 
 /// Prototype for a command that must be executed.
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct CommandPrototype {
     ty: CommandType,
     args: Vec<CString>,
@@ -125,7 +125,7 @@ impl Show for CommandPrototype {
     }
 }
 
-#[deriving(Clone, Show)]
+#[derive(Clone, Show)]
 pub enum CommandType {
     Rustc,
     Rustdoc,
index b8e390020311217ea34d3ed3fcff1b9be6fe0221..bd64d2f8725d74db56420f966ca106d75766115f 100644 (file)
@@ -1,7 +1,7 @@
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::hash::{Hash, Hasher};
 use std::hash::sip::SipHasher;
-use std::io::{mod, fs, File, BufferedReader};
+use std::io::{self, fs, File, BufferedReader};
 use std::io::fs::PathExtensions;
 
 use core::{Package, Target};
@@ -96,10 +96,10 @@ pub fn prepare_target(cx: &mut Context, pkg: &Package, target: &Target,
             } else if target.is_bin() {
                 cx.compilation.binaries.push(dst);
             } else if target.is_lib() {
-                let pkgid = pkg.get_package_id().clone();
+                let pkgid = pkg.get_package_id();
                 match cx.compilation.libraries.entry(pkgid) {
                     Occupied(entry) => entry.into_mut(),
-                    Vacant(entry) => entry.set(Vec::new()),
+                    Vacant(entry) => entry.insert(Vec::new()),
                 }.push(dst);
             }
         }
index a76f3039e8ea38d03128a2da27a2aa8ebebdfdca..2e68f496f3c3461ee924fd728faa3469af65a011 100644 (file)
@@ -1,3 +1,5 @@
+use std::sync::mpsc::Sender;
+
 use util::{CargoResult, Fresh, Dirty, Freshness};
 
 pub struct Job { dirty: Work, fresh: Work }
index 41f6d172323a86ea50c59c075976aca41445d5f3..3e075368bc48ac4e81057accf10ea452f04a73f5 100644 (file)
@@ -2,6 +2,7 @@ use std::collections::HashSet;
 use std::collections::hash_map::HashMap;
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::sync::TaskPool;
+use std::sync::mpsc::{channel, Sender, Receiver};
 use term::color::YELLOW;
 
 use core::{Package, PackageId, Resolve, PackageSet};
@@ -48,7 +49,7 @@ struct PendingBuild {
 ///
 /// Each build step for a package is registered with one of these stages, and
 /// each stage has a vector of work to perform in parallel.
-#[deriving(Hash, PartialEq, Eq, Clone, PartialOrd, Ord, Show, Copy)]
+#[derive(Hash, PartialEq, Eq, Clone, PartialOrd, Ord, Show, Copy)]
 pub enum Stage {
     Start,
     BuildCustomBuild,
@@ -85,9 +86,9 @@ impl<'a, 'b> JobQueue<'a, 'b> {
         // Record the freshness state of this package as dirty if any job is
         // dirty or fresh otherwise
         let fresh = jobs.iter().fold(Fresh, |f1, &(_, f2)| f1.combine(f2));
-        match self.state.entry(pkg.get_package_id()) {
+        match self.state.entry(&pkg.get_package_id()) {
             Occupied(mut entry) => { *entry.get_mut() = entry.get().combine(fresh); }
-            Vacant(entry) => { entry.set(fresh); }
+            Vacant(entry) => { entry.insert(fresh); }
         };
 
         // Add the package to the dependency graph
@@ -125,7 +126,7 @@ impl<'a, 'b> JobQueue<'a, 'b> {
             // Now that all possible work has been scheduled, wait for a piece
             // of work to finish. If any package fails to build then we stop
             // scheduling work as quickly as possibly.
-            let (id, stage, fresh, result) = self.rx.recv();
+            let (id, stage, fresh, result) = self.rx.recv().unwrap();
             info!("  end: {} {}", id, stage);
             let id = *self.state.keys().find(|&k| *k == &id).unwrap();
             self.active -= 1;
@@ -184,10 +185,10 @@ impl<'a, 'b> JobQueue<'a, 'b> {
             let id = id.clone();
             let (desc_tx, desc_rx) = channel();
             self.pool.execute(move|| {
-                my_tx.send((id, stage, fresh, job.run(fresh, desc_tx)));
+                my_tx.send((id, stage, fresh, job.run(fresh, desc_tx))).unwrap();
             });
             // only the first message of each job is processed
-            match desc_rx.recv_opt() {
+            match desc_rx.recv() {
                 Ok(msg) => running.push(msg),
                 Err(..) => {}
             }
@@ -196,7 +197,7 @@ impl<'a, 'b> JobQueue<'a, 'b> {
         // If no work was scheduled, make sure that a message is actually send
         // on this channel.
         if njobs == 0 {
-            self.tx.send((id, stage, fresh, Ok(())));
+            self.tx.send((id, stage, fresh, Ok(()))).unwrap();
         }
 
         // Print out some nice progress information
index 2b277a55836dff708a3882dcf05aac0a6fc21288..cccc42a3e1a950d62811caa1118453bd19cdd4f5 100644 (file)
@@ -48,7 +48,7 @@
 use std::cell::RefCell;
 use std::collections::HashSet;
 use std::io::fs::PathExtensions;
-use std::io::{mod, fs, IoResult};
+use std::io::{self, fs, IoResult};
 use std::mem;
 
 use core::Package;
index 5919615b5a8ccd3d5cd72d27dcd8bbc797438f4c..a9902f88041497bd98b4280defd5ba660d8319cc 100644 (file)
@@ -1,11 +1,12 @@
+use std::c_str::ToCStr;
 use std::collections::{HashSet, HashMap};
 use std::dynamic_lib::DynamicLibrary;
-use std::io::{fs, USER_RWX};
-use std::io::fs::PathExtensions;
+use std::io::USER_RWX;
+use std::io::fs::{self, PathExtensions};
 use std::sync::Arc;
 
 use core::{SourceMap, Package, PackageId, PackageSet, Target, Resolve};
-use util::{mod, CargoResult, human, caused_human};
+use util::{self, CargoResult, human, caused_human};
 use util::{Config, internal, ChainError, Fresh, profile, join_paths, Human};
 
 use self::job::{Job, Work};
@@ -28,16 +29,16 @@ mod job_queue;
 mod layout;
 mod links;
 
-#[deriving(PartialEq, Eq, Hash, Show, Copy)]
+#[derive(PartialEq, Eq, Hash, Show, Copy)]
 pub enum Kind { Host, Target }
 
-#[deriving(Default, Clone)]
+#[derive(Default, Clone)]
 pub struct BuildConfig {
     pub host: TargetConfig,
     pub target: TargetConfig,
 }
 
-#[deriving(Clone, Default)]
+#[derive(Clone, Default)]
 pub struct TargetConfig {
     pub ar: Option<String>,
     pub linker: Option<String>,
@@ -262,7 +263,7 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package,
             let (freshness, dirty, fresh) =
                 try!(fingerprint::prepare_target(cx, pkg, target, kind));
 
-            let dirty = Work::new(move |desc_tx: Sender<String>| {
+            let dirty = Work::new(move |desc_tx| {
                 try!(work.call(desc_tx.clone()));
                 dirty.call(desc_tx)
             });
@@ -332,9 +333,9 @@ fn compile<'a, 'b>(targets: &[&'a Target], pkg: &'a Package,
             1 => pkg.get_manifest().get_build()[0].to_string(),
             _ => format!("custom build commands"),
         };
-        let dirty = Work::new(move |desc_tx: Sender<String>| {
+        let dirty = Work::new(move |desc_tx| {
             if desc.len() > 0 {
-                desc_tx.send_opt(desc).ok();
+                desc_tx.send(desc).ok();
             }
             for cmd in build_cmds.into_iter() {
                 try!(cmd.call(desc_tx.clone()))
@@ -411,8 +412,8 @@ fn compile_custom_old(pkg: &Package, cmd: &str,
 
     let exec_engine = cx.exec_engine.clone();
 
-    Ok(Work::new(move |desc_tx: Sender<String>| {
-        desc_tx.send_opt(p.to_string()).ok();
+    Ok(Work::new(move |desc_tx| {
+        desc_tx.send(p.to_string()).ok();
         if first && !output.exists() {
             try!(fs::mkdir(&output, USER_RWX).chain_error(|| {
                 internal("failed to create output directory for build command")
@@ -516,7 +517,7 @@ fn rustc(package: &Package, target: &Target,
                 }
             }
 
-            desc_tx.send_opt(rustc.to_string()).ok();
+            desc_tx.send(rustc.to_string()).ok();
             try!(exec_engine.exec(rustc).chain_error(|| {
                 human(format!("Could not compile `{}`.", name))
             }));
@@ -588,8 +589,8 @@ fn rustdoc(package: &Package, target: &Target,
     let desc = rustdoc.to_string();
     let exec_engine = cx.exec_engine.clone();
 
-    Ok(Work::new(move |desc_tx: Sender<String>| {
-        desc_tx.send(desc);
+    Ok(Work::new(move |desc_tx| {
+        desc_tx.send(desc).unwrap();
         if primary {
             try!(exec_engine.exec(rustdoc).chain_error(|| {
                 human(format!("Could not document `{}`.", name))
index 888538a32ec17e4acb28c7beb22f9933a63698a1..9d18c03b092890167107f943c295739c4b637dc4 100644 (file)
@@ -2,7 +2,7 @@ use std::os;
 
 use core::Source;
 use sources::PathSource;
-use ops::{mod, ExecEngine, ProcessEngine};
+use ops::{self, ExecEngine, ProcessEngine};
 use util::{CargoResult, ProcessError};
 
 pub struct TestOptions<'a> {
index b5a8414b0e448e13bd1e24c7973910b5bd71e70f..463d9467695524e786671aa2a82f80f00a1416dc 100644 (file)
@@ -1,7 +1,7 @@
 use std::io::File;
 
 use rustc_serialize::{Encodable, Decodable};
-use toml::{mod, Encoder, Value};
+use toml::{self, Encoder, Value};
 
 use core::{Resolve, resolver, Package, SourceId};
 use util::CargoResult;
index e1bb3948dd31203eb0daf6c80793158c9aa80d41..cdfac35cda6665857006075f8cc177b62117f0b1 100644 (file)
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
 
 use core::{Package, PackageId, SourceId};
 use core::registry::PackageRegistry;
-use core::resolver::{mod, Resolve, Method};
+use core::resolver::{self, Resolve, Method};
 use ops;
 use util::CargoResult;
 
index 605ff5a71431c6f943217dadd0581494a01e45fd..711a114eeae0362ed603849dfec35d7365684e8c 100644 (file)
@@ -1,8 +1,8 @@
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 use std::hash::Hasher;
 use std::hash::sip::SipHasher;
 use std::mem;
-use url::{mod, Url};
+use url::{self, Url};
 
 use core::source::{Source, SourceId};
 use core::GitReference;
index 1f6c0aed89b38b902f4926fc96cf00ce5c3b0c3a..cc6d801f0f222213bc0928c9991fd99f35ef6cb3 100644 (file)
@@ -1,4 +1,4 @@
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 use std::io::{USER_DIR};
 use std::io::fs::{mkdir_recursive, rmdir_recursive, PathExtensions};
 use rustc_serialize::{Encodable, Encoder};
@@ -8,7 +8,7 @@ use git2;
 use core::GitReference;
 use util::{CargoResult, ChainError, human, ToUrl, internal};
 
-#[deriving(PartialEq, Clone)]
+#[derive(PartialEq, Clone)]
 #[allow(missing_copy_implementations)]
 pub struct GitRevision(git2::Oid);
 
@@ -20,12 +20,12 @@ impl Show for GitRevision {
 
 /// GitRemote represents a remote repository. It gets cloned into a local
 /// GitDatabase.
-#[deriving(PartialEq,Clone,Show)]
+#[derive(PartialEq,Clone,Show)]
 pub struct GitRemote {
     url: Url,
 }
 
-#[deriving(PartialEq,Clone,RustcEncodable)]
+#[derive(PartialEq,Clone,RustcEncodable)]
 struct EncodableGitRemote {
     url: String,
 }
@@ -46,7 +46,7 @@ pub struct GitDatabase {
     repo: git2::Repository,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 pub struct EncodableGitDatabase {
     remote: GitRemote,
     path: String,
@@ -71,7 +71,7 @@ pub struct GitCheckout<'a> {
     repo: git2::Repository,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 pub struct EncodableGitCheckout {
     database: EncodableGitDatabase,
     location: String,
index d6a012fc571db8b24ee9c19878cdedcd3a72a40e..a068386dded7f7d6695e41ca1b32b15725cbdbfa 100644 (file)
@@ -1,6 +1,6 @@
 use std::cmp;
-use std::fmt::{mod, Show, Formatter};
-use std::io::fs::{mod, PathExtensions};
+use std::fmt::{self, Show, Formatter};
+use std::io::fs::{self, PathExtensions};
 use glob::Pattern;
 use git2;
 
index 8239216585e80fd737ecd56921f665430de29cc8..0c40ee4ccc7fe641d258edb2882dd204c3ed3bf1 100644 (file)
 //!         ...
 //! ```
 
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 use std::io::fs::PathExtensions;
 use std::collections::HashMap;
 
@@ -192,7 +192,7 @@ pub struct RegistrySource<'a, 'b:'a> {
     updated: bool,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub struct RegistryConfig {
     /// Download endpoint for all crates. This will be appended with
     /// `/<crate>/<version>/download` and then will be hit with an HTTP GET
@@ -204,7 +204,7 @@ pub struct RegistryConfig {
     pub api: String,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct RegistryPackage {
     name: String,
     vers: String,
@@ -214,7 +214,7 @@ struct RegistryPackage {
     yanked: Option<bool>,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct RegistryDependency {
     name: String,
     req: String,
index 885f4b1765367ac502b1fb6331abce94948f0d38..3e3f74359c272ae0f05e518e87a310def3697ba5 100644 (file)
@@ -3,7 +3,7 @@ use std::cell::{RefCell, RefMut};
 use std::collections::hash_map::{HashMap};
 use std::collections::hash_map::Entry::{Occupied, Vacant};
 use std::io;
-use std::io::fs::{mod, PathExtensions, File};
+use std::io::fs::{self, PathExtensions, File};
 use std::string;
 
 use rustc_serialize::{Encodable,Encoder};
@@ -94,13 +94,13 @@ impl<'a> Config<'a> {
     }
 }
 
-#[deriving(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)]
+#[derive(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)]
 pub enum Location {
     Project,
     Global
 }
 
-#[deriving(Eq,PartialEq,Clone,RustcDecodable)]
+#[derive(Eq,PartialEq,Clone,RustcDecodable)]
 pub enum ConfigValue {
     String(string::String, Path),
     List(Vec<(string::String, Path)>),
@@ -178,9 +178,9 @@ impl ConfigValue {
             (&CV::Table(ref mut old), CV::Table(ref mut new)) => {
                 let new = mem::replace(new, HashMap::new());
                 for (key, value) in new.into_iter() {
-                    match old.entry(key) {
+                    match old.entry(&key) {
                         Occupied(mut entry) => { try!(entry.get_mut().merge(value)); }
-                        Vacant(entry) => { entry.set(value); }
+                        Vacant(entry) => { entry.insert(value); }
                     };
                 }
             }
index 266071233eb8fd82f3643be6b3cd0575b4c8631a..ae7395be4342915ebc85212e58585672231d6bea 100644 (file)
@@ -40,7 +40,7 @@ pub struct DependencyQueue<K, V> {
 ///
 /// A fresh package does not necessarily need to be rebuilt (unless a dependency
 /// was also rebuilt), and a dirty package must always be rebuilt.
-#[deriving(PartialEq, Eq, Show, Copy)]
+#[derive(PartialEq, Eq, Show, Copy)]
 pub enum Freshness {
     Fresh,
     Dirty,
@@ -83,9 +83,9 @@ impl<C, K: Dependency<C>, V> DependencyQueue<K, V> {
         let mut my_dependencies = HashSet::new();
         for dep in key.dependencies(cx).into_iter() {
             assert!(my_dependencies.insert(dep.clone()));
-            let rev = match self.reverse_dep_map.entry(dep) {
+            let rev = match self.reverse_dep_map.entry(&dep) {
                 Occupied(entry) => entry.into_mut(),
-                Vacant(entry) => entry.set(HashSet::new()),
+                Vacant(entry) => entry.insert(HashSet::new()),
             };
             assert!(rev.insert(key.clone()));
         }
index bfdc7ed24fd1897546d75f801338e41aee228252..211af049abd5356677ba62b3104054ccef588096 100644 (file)
@@ -1,5 +1,5 @@
 use std::error::{FromError, Error};
-use std::fmt::{mod, Show};
+use std::fmt::{self, Show};
 use std::io::IoError;
 use std::io::process::{ProcessOutput, ProcessExit, ExitStatus, ExitSignal};
 use std::str;
@@ -164,7 +164,7 @@ impl<E: Error> CargoError for Human<E> {
 
 pub type CliResult<T> = Result<T, CliError>;
 
-#[deriving(Show)]
+#[derive(Show)]
 pub struct CliError {
     pub error: Box<CargoError>,
     pub unknown: bool,
index b5f4a6335ccd24e31fa912123f24aca22111b00a..b3214e5ff7a0200665887f9b77444311eef0a5c7 100644 (file)
@@ -27,9 +27,9 @@ impl<N: Eq + Hash + Clone> Graph<N> {
     }
 
     pub fn link(&mut self, node: N, child: N) {
-        match self.nodes.entry(node) {
+        match self.nodes.entry(&node) {
             Occupied(entry) => entry.into_mut(),
-            Vacant(entry) => entry.set(HashSet::new()),
+            Vacant(entry) => entry.insert(HashSet::new()),
         }.insert(child);
     }
 
index 722ac7fdc12549687a09c30e6cd7dccd656bbab6..5f07d4f95b9f948cf7b449877109ea2bbf2e85dd 100644 (file)
@@ -1,12 +1,12 @@
-use std::fmt::{mod, Show, Formatter};
+use std::fmt::{self, Show, Formatter};
 use std::os;
-use std::c_str::CString;
+use std::c_str::{CString, ToCStr};
 use std::io::process::{Command, ProcessOutput, InheritFd};
 use std::collections::HashMap;
 
 use util::{CargoResult, ProcessError, process_error};
 
-#[deriving(Clone,PartialEq)]
+#[derive(Clone,PartialEq)]
 pub struct ProcessBuilder {
     program: CString,
     args: Vec<CString>,
index 88419ae15e14dfe652769d42eb106d5fd4cff56b..4736e3407166c66f7a28bc8ec65568f8e33b656e 100644 (file)
@@ -48,9 +48,9 @@ mod imp {
             }
         }
 
-        pub fn finish(&mut self) -> [u8, ..32] {
+        pub fn finish(&mut self) -> [u832] {
             unsafe {
-                let mut ret = [0u8, ..32];
+                let mut ret = [0u832];
                 let mut out = 0;
                 let n = EVP_DigestFinal_ex(self.ctx, ret.as_mut_ptr(), &mut out);
                 assert_eq!(n, 1);
@@ -141,8 +141,8 @@ mod imp {
             })
         }
 
-        pub fn finish(&mut self) -> [u8, ..32] {
-            let mut ret = [0u8, ..32];
+        pub fn finish(&mut self) -> [u832] {
+            let mut ret = [0u832];
             let mut len = ret.len() as libc::DWORD;
             call!(unsafe {
                 CryptGetHashParam(self.hcrypthash, HP_HASHVAL, ret.as_mut_ptr(),
index f11b9641489f331d4b3db44484822073f7159c7a..840d7116596177c3e5abe5c4a20a170c2ba8caca 100644 (file)
@@ -1,4 +1,4 @@
-use url::{mod, Url, UrlParser};
+use url::{self, Url, UrlParser};
 
 pub trait ToUrl {
     fn to_url(self) -> Result<Url, String>;
index d76b902e32d97f5a955eb2b3fbdd65289927ccf0..be863795b6573888668f78c97d49916dcf6888d4 100644 (file)
@@ -1,7 +1,7 @@
 use std::collections::HashMap;
 
 use std::fmt;
-use std::io::fs::{mod, PathExtensions};
+use std::io::fs::{self, PathExtensions};
 use std::os;
 use std::slice;
 use std::str;
@@ -21,7 +21,7 @@ use util::{CargoResult, human, ToUrl, ToSemver, ChainError};
 ///
 /// This structure is used to hold references to all project files that are relevant to cargo.
 
-#[deriving(Clone)]
+#[derive(Clone)]
 pub struct Layout {
     root: Path,
     lib: Option<Path>,
@@ -182,14 +182,14 @@ type TomlBenchTarget = TomlTarget;
  * TODO: Make all struct fields private
  */
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub enum TomlDependency {
     Simple(String),
     Detailed(DetailedTomlDependency)
 }
 
 
-#[deriving(RustcDecodable, Clone, Default)]
+#[derive(RustcDecodable, Clone, Default)]
 pub struct DetailedTomlDependency {
     version: Option<String>,
     path: Option<String>,
@@ -202,7 +202,7 @@ pub struct DetailedTomlDependency {
     default_features: Option<bool>,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub struct TomlManifest {
     package: Option<Box<TomlProject>>,
     project: Option<Box<TomlProject>>,
@@ -219,7 +219,7 @@ pub struct TomlManifest {
     target: Option<HashMap<String, TomlPlatform>>,
 }
 
-#[deriving(RustcDecodable, Clone, Default)]
+#[derive(RustcDecodable, Clone, Default)]
 pub struct TomlProfiles {
     test: Option<TomlProfile>,
     doc: Option<TomlProfile>,
@@ -228,7 +228,7 @@ pub struct TomlProfiles {
     release: Option<TomlProfile>,
 }
 
-#[deriving(RustcDecodable, Clone, Default)]
+#[derive(RustcDecodable, Clone, Default)]
 #[allow(missing_copy_implementations)]
 pub struct TomlProfile {
     opt_level: Option<uint>,
@@ -238,7 +238,7 @@ pub struct TomlProfile {
     rpath: Option<bool>,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub enum ManyOrOne<T> {
     Many(Vec<T>),
     One(T),
@@ -253,7 +253,7 @@ impl<T> ManyOrOne<T> {
     }
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub struct TomlProject {
     name: String,
     version: TomlVersion,
@@ -274,7 +274,7 @@ pub struct TomlProject {
 }
 
 // TODO: deprecated, remove
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub enum BuildCommand {
     Single(String),
     Multiple(Vec<String>)
@@ -605,7 +605,7 @@ fn process_dependencies<'a>(cx: &mut Context<'a>,
     Ok(())
 }
 
-#[deriving(RustcDecodable, Show, Clone)]
+#[derive(RustcDecodable, Show, Clone)]
 struct TomlTarget {
     name: String,
     crate_type: Option<Vec<String>>,
@@ -618,14 +618,14 @@ struct TomlTarget {
     harness: Option<bool>,
 }
 
-#[deriving(RustcDecodable, Clone)]
+#[derive(RustcDecodable, Clone)]
 enum PathValue {
     String(String),
     Path(Path),
 }
 
 /// Corresponds to a `target` entry, but `TomlTarget` is already used.
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 struct TomlPlatform {
     dependencies: Option<HashMap<String, TomlDependency>>,
 }
@@ -675,7 +675,7 @@ fn normalize(libs: &[TomlLibTarget],
     log!(4, "normalizing toml targets; lib={}; bin={}; example={}; test={}, benches={}",
          libs, bins, examples, tests, benches);
 
-    #[deriving(Copy)]
+    #[derive(Copy)]
     enum TestDep { Needed, NotNeeded }
 
     fn merge(profile: Profile, toml: &Option<TomlProfile>) -> Profile {
index 9c7207a7e73ee261aa13ba422c576a2c7a34eb03..4c1512437f6e5e8c7e01b6b0a96f7a80afdbb0fb 100644 (file)
@@ -8,5 +8,5 @@ name = "registry"
 path = "lib.rs"
 
 [dependencies]
-curl = "0.1.0"
-rustc-serialize = "0.1.1"
+curl = "0.1"
+rustc-serialize = "0.2"
index 75cc5a6d2580338b50c04930e2c37e013ce3f976..f153592a82472a19ff0b88cd5e1b91d60198f463 100644 (file)
@@ -1,8 +1,10 @@
+#![feature(old_orphan_check)]
+
 extern crate curl;
 extern crate "rustc-serialize" as rustc_serialize;
 
 use std::fmt;
-use std::io::{mod, fs, MemReader, MemWriter, File};
+use std::io::{self, fs, MemReader, MemWriter, File};
 use std::collections::HashMap;
 use std::io::util::ChainedReader;
 use std::result;
@@ -21,7 +23,7 @@ pub struct Registry {
 
 pub type Result<T> = result::Result<T, Error>;
 
-#[deriving(PartialEq, Copy)]
+#[derive(PartialEq, Copy)]
 pub enum Auth {
     Authorized,
     Unauthorized
@@ -37,14 +39,14 @@ pub enum Error {
     Io(io::IoError),
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub struct Crate {
     pub name: String,
     pub description: Option<String>,
     pub max_version: String
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 pub struct NewCrate {
     pub name: String,
     pub vers: String,
@@ -61,7 +63,7 @@ pub struct NewCrate {
     pub repository: Option<String>,
 }
 
-#[deriving(RustcEncodable)]
+#[derive(RustcEncodable)]
 pub struct NewCrateDependency {
     pub optional: bool,
     pub default_features: bool,
@@ -72,7 +74,7 @@ pub struct NewCrateDependency {
     pub kind: String,
 }
 
-#[deriving(RustcDecodable)]
+#[derive(RustcDecodable)]
 pub struct User {
     pub id: uint,
     pub login: String,
@@ -81,12 +83,12 @@ pub struct User {
     pub name: Option<String>,
 }
 
-#[deriving(RustcDecodable)] struct R { ok: bool }
-#[deriving(RustcDecodable)] struct ApiErrorList { errors: Vec<ApiError> }
-#[deriving(RustcDecodable)] struct ApiError { detail: String }
-#[deriving(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
-#[deriving(RustcDecodable)] struct Users { users: Vec<User> }
-#[deriving(RustcDecodable)] struct Crates { crates: Vec<Crate> }
+#[derive(RustcDecodable)] struct R { ok: bool }
+#[derive(RustcDecodable)] struct ApiErrorList { errors: Vec<ApiError> }
+#[derive(RustcDecodable)] struct ApiError { detail: String }
+#[derive(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
+#[derive(RustcDecodable)] struct Users { users: Vec<User> }
+#[derive(RustcDecodable)] struct Crates { crates: Vec<Crate> }
 
 impl Registry {
     pub fn new(host: String, token: Option<String>) -> Registry {
index 128b79ec59bd704540a1e0ea7ba96431cb9bd2c8..51e0fdc8de41a61d2e520588bdc730a04478ac5c 100644 (file)
@@ -1 +1 @@
-2015-01-02
+2015-01-05
index d55b0a8604fcaec5177557d9e59a26fec629339e..d230a78a682d897f15b39458d3ab09b3aa0fd746 100644 (file)
@@ -11,7 +11,7 @@ use cargo::core::source::{SourceId, GitReference};
 use cargo::core::dependency::Kind::Development;
 use cargo::core::{Dependency, PackageId, Summary, Registry};
 use cargo::util::{CargoResult, ToUrl};
-use cargo::core::resolver::{mod, Method};
+use cargo::core::resolver::{self, Method};
 
 fn resolve<R: Registry>(pkg: PackageId, deps: Vec<Dependency>,
                         registry: &mut R)
index f41baf45118c18252e1f1f691ae201cff1599796..af8fef689d07cf5222862b482867b31fb35e3cc9 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 
 use url::Url;
 use git2;
index 9710c0782894db845d70876c1531104b2b87663a..12d3bdfee5c8d705a94ccefd0f4763033c7a47dd 100644 (file)
@@ -1,11 +1,12 @@
+use std::c_str::ToCStr;
 use std::error::Error;
-use std::fmt::{mod, Show};
-use std::io::fs::{mod, PathExtensions};
+use std::fmt::{self, Show};
+use std::io::fs::{self, PathExtensions};
 use std::io::process::{ProcessOutput};
 use std::io;
 use std::os;
 use std::path::{Path,BytesContainer};
-use std::str::{mod, Str};
+use std::str::{self, Str};
 
 use url::Url;
 use hamcrest as ham;
@@ -24,7 +25,7 @@ pub mod registry;
  *
  */
 
-#[deriving(PartialEq,Clone)]
+#[derive(PartialEq,Clone)]
 struct FileBuilder {
     path: Path,
     body: String
@@ -53,7 +54,7 @@ impl FileBuilder {
     }
 }
 
-#[deriving(PartialEq,Clone)]
+#[derive(PartialEq,Clone)]
 struct SymlinkBuilder {
     dst: Path,
     src: Path
@@ -77,7 +78,7 @@ impl SymlinkBuilder {
     }
 }
 
-#[deriving(PartialEq,Clone)]
+#[derive(PartialEq,Clone)]
 pub struct ProjectBuilder {
     name: String,
     root: Path,
@@ -241,7 +242,7 @@ pub fn cargo_dir() -> Path {
  *
  */
 
-#[deriving(Clone)]
+#[derive(Clone)]
 struct Execs {
     expect_stdout: Option<String>,
     expect_stdin: Option<String>,
@@ -363,7 +364,8 @@ struct ZipAll<T, I1, I2> {
     second: I2,
 }
 
-impl<T, I1: Iterator<T>, I2: Iterator<T>> Iterator<(Option<T>, Option<T>)> for ZipAll<T, I1, I2> {
+impl<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>> Iterator for ZipAll<T, I1, I2> {
+    type Item = (Option<T>, Option<T>);
     fn next(&mut self) -> Option<(Option<T>, Option<T>)> {
         let first = self.first.next();
         let second = self.second.next();
@@ -375,7 +377,7 @@ impl<T, I1: Iterator<T>, I2: Iterator<T>> Iterator<(Option<T>, Option<T>)> for Z
     }
 }
 
-fn zip_all<T, I1: Iterator<T>, I2: Iterator<T>>(a: I1, b: I2) -> ZipAll<T, I1, I2> {
+fn zip_all<T, I1: Iterator<Item=T>, I2: Iterator<Item=T>>(a: I1, b: I2) -> ZipAll<T, I1, I2> {
     ZipAll {
         first: a,
         second: b
@@ -419,7 +421,7 @@ pub fn execs() -> Execs {
     }
 }
 
-#[deriving(Clone)]
+#[derive(Clone)]
 struct ShellWrites {
     expected: String
 }
index f5b701dcd33fa75a753630907dbe44065f7fa579..23ffa090337c0d4ebe1aa3c2903f0f3df8b4f1ad 100644 (file)
@@ -1,13 +1,13 @@
 use std::io::IoResult;
-use std::io::fs::{mod, PathExtensions};
-use std::sync::atomic;
+use std::io::fs::{self, PathExtensions};
+use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
 use std::{io, os};
 
 use cargo::util::realpath;
 
 static CARGO_INTEGRATION_TEST_DIR : &'static str = "cit";
-static NEXT_ID: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
-thread_local!(static TASK_ID: uint = NEXT_ID.fetch_add(1, atomic::SeqCst));
+static NEXT_ID: AtomicUint = ATOMIC_UINT_INIT;
+thread_local!(static TASK_ID: uint = NEXT_ID.fetch_add(1, Ordering::SeqCst));
 
 pub fn root() -> Path {
     let path = os::self_exe_path().unwrap()
index 769583d1ced7f4c732d55ef0e11a6d5247a3fb7d..267e0888b6e6e8f079e749fadc7db4d3ed373d32 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 
 use flate2::CompressionLevel::Default;
 use flate2::writer::GzEncoder;
index 1456ea5810a9b912fe6c991ef713012592e98773..9491646c6a184583668eb92952bf4248a502f557 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::fs::{mod, PathExtensions};
+use std::io::fs::{self, PathExtensions};
 use std::io;
 use std::io::{USER_RWX, File};
 use std::os;
index bff29e02d0577cc6905d96bb2552d25fd3e838ac..2572cf0ef00e2bcc839abea4a57e96e05114a44c 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::{mod, fs, TempDir, File};
+use std::io::{self, fs, TempDir, File};
 use std::os;
 use std::path;
 
@@ -920,7 +920,7 @@ test!(explicit_examples {
             fn main() { println!("{}, {}!", world::get_goodbye(), world::get_world()); }
         "#);
 
-    assert_that(p.cargo_process("test"), execs());
+    assert_that(p.cargo_process("test"), execs().with_status(0));
     assert_that(process(p.bin("examples/hello")).unwrap(),
                         execs().with_stdout("Hello, World!\n"));
     assert_that(process(p.bin("examples/goodbye")).unwrap(),
index 0c1a9d1ddc6556ddf18b9aa6f15b5b65871b08b1..3e6a75294df2bcab67b45f89d8e96289b90d9ead 100644 (file)
@@ -2,7 +2,7 @@ use std::io::{fs, File, USER_RWX};
 
 use support::{project, execs, main_file, cargo_dir};
 use support::{COMPILING, RUNNING};
-use support::paths::{mod, PathExt};
+use support::paths::{self, PathExt};
 use hamcrest::{assert_that, existing_file};
 use cargo;
 use cargo::util::{process};
@@ -71,7 +71,8 @@ test!(cargo_compile_with_nested_deps_shorthand {
         "#);
 
     assert_that(p.cargo_process("build"),
-        execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
+        execs().with_status(0)
+               .with_stdout(format!("{} baz v0.5.0 ({})\n\
                                      {} bar v0.5.0 ({})\n\
                                      {} foo v0.5.0 ({})\n",
                                     COMPILING, p.url(),
@@ -82,20 +83,22 @@ test!(cargo_compile_with_nested_deps_shorthand {
 
     assert_that(
       cargo::util::process(p.bin("foo")).unwrap(),
-      execs().with_stdout("test passed\n"));
+      execs().with_stdout("test passed\n").with_status(0));
 
     println!("cleaning");
     assert_that(p.process(cargo_dir().join("cargo")).arg("clean"),
-                execs().with_stdout(""));
+                execs().with_stdout("").with_status(0));
     println!("building baz");
     assert_that(p.process(cargo_dir().join("cargo")).arg("build")
                  .arg("-p").arg("baz"),
-                execs().with_stdout(format!("{} baz v0.5.0 ({})\n",
+                execs().with_status(0)
+                       .with_stdout(format!("{} baz v0.5.0 ({})\n",
                                             COMPILING, p.url())));
     println!("building foo");
     assert_that(p.process(cargo_dir().join("cargo")).arg("build")
                  .arg("-p").arg("foo"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
+                execs().with_status(0)
+                       .with_stdout(format!("{} bar v0.5.0 ({})\n\
                                              {} foo v0.5.0 ({})\n",
                                             COMPILING, p.url(),
                                             COMPILING, p.url())));
index 01891bac8ecd48ec13a786c7ba38a131da55ec48..65d91503523cbe2c50c2c6073720bc9b3f8f4ef1 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::{mod, fs, File, MemReader};
+use std::io::{self, fs, File, MemReader};
 
 use flate2::reader::GzDecoder;
 use tar::Archive;
index 3c7abcb517bbd310ae38e0780c6cfae316148ba9..bde5d77f1665d06dd5da69198cbccee4d8ad5f7c 100644 (file)
@@ -1,9 +1,9 @@
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 use cargo::util::process;
 
 use support::{project, execs, cargo_dir};
 use support::{UPDATING, DOWNLOADING, COMPILING, PACKAGING, VERIFYING};
-use support::paths::{mod, PathExt};
+use support::paths::{self, PathExt};
 use support::registry as r;
 use support::git;
 
index 53dca1ebb1d86ce29cfbaac9539b57024b13c468..6a9462eaec5954a375b64a97a6af7b576a47e894 100644 (file)
@@ -1,4 +1,4 @@
-use std::io::{mod, fs, File};
+use std::io::{self, fs, File};
 
 use url::Url;
 
index cb84e1642d2c1fd77029febc70a14c52165eac59..f3b07efb8a2b1852f626aadfa35b623dc6d8130c 100644 (file)
@@ -1,4 +1,5 @@
 use std::io::{MemWriter, IoResult, ChanReader, ChanWriter};
+use std::sync::mpsc::channel;
 use term::{Terminal, TerminfoTerminal, color};
 use hamcrest::{assert_that};
 
index caa4d2d0bd1dd2271bfea0d0cd178de83f9cc800..a4c1f5c797aa0fcfd1abc8c924b57fd6bea56699 100644 (file)
@@ -1,4 +1,4 @@
-#![feature(macro_rules)]
+#![feature(macro_rules, associated_types)]
 #![feature(phase)]
 #![deny(warnings)]